package cn.tedu.spring.eg3;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class ShopController {
    private String str;

    public ShopController() {
        System.out.println("1.实例化");}
    @Value("qwer")
    public void setStr(String str) {
        this.str = str;
        System.out.println("2.属性赋值");
    }
    @PostConstruct
    public void shopping(){
        System.out.println("3初始化");
    }
    @PreDestroy
    public void close(){
        System.out.println("5.关闭");
    }
}
